package com.appkubes.mall.core.pojo;

import com.appkubes.mall.core.po.MallArticle;
import com.appkubes.mall.core.po.MallArticleExample;
import com.appkubes.mall.core.po.MallArticleWithBLOBs;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.session.RowBounds;
import org.apache.ibatis.type.JdbcType;

public interface MallArticleMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_article
     *
     * @mbg.generated
     */
    @SelectProvider(type=MallArticleSqlProvider.class, method="countByExample")
    long countByExample(MallArticleExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_article
     *
     * @mbg.generated
     */
    @DeleteProvider(type=MallArticleSqlProvider.class, method="deleteByExample")
    int deleteByExample(MallArticleExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_article
     *
     * @mbg.generated
     */
    @Delete({
        "delete from mall_article",
        "where article_key = #{articleKey,jdbcType=VARCHAR}"
    })
    int deleteByPrimaryKey(String articleKey);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_article
     *
     * @mbg.generated
     */
    @Insert({
        "insert into mall_article (article_key, app_key, ",
        "`state`, create_time, ",
        "update_time, `type`, ",
        "version, title, ",
        "content)",
        "values (#{articleKey,jdbcType=VARCHAR}, #{appKey,jdbcType=VARCHAR}, ",
        "#{state,jdbcType=TINYINT}, #{createTime,jdbcType=INTEGER}, ",
        "#{updateTime,jdbcType=INTEGER}, #{type,jdbcType=INTEGER}, ",
        "#{version,jdbcType=INTEGER}, #{title,jdbcType=LONGVARCHAR}, ",
        "#{content,jdbcType=LONGVARCHAR})"
    })
    int insert(MallArticleWithBLOBs record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_article
     *
     * @mbg.generated
     */
    @InsertProvider(type=MallArticleSqlProvider.class, method="insertSelective")
    int insertSelective(MallArticleWithBLOBs record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_article
     *
     * @mbg.generated
     */
    @SelectProvider(type=MallArticleSqlProvider.class, method="selectByExampleWithBLOBs")
    @Results({
        @Result(column="article_key", property="articleKey", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="app_key", property="appKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="state", property="state", jdbcType=JdbcType.TINYINT),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.INTEGER),
        @Result(column="update_time", property="updateTime", jdbcType=JdbcType.INTEGER),
        @Result(column="type", property="type", jdbcType=JdbcType.INTEGER),
        @Result(column="version", property="version", jdbcType=JdbcType.INTEGER),
        @Result(column="title", property="title", jdbcType=JdbcType.LONGVARCHAR),
        @Result(column="content", property="content", jdbcType=JdbcType.LONGVARCHAR)
    })
    List<MallArticleWithBLOBs> selectByExampleWithBLOBsWithRowbounds(MallArticleExample example, RowBounds rowBounds);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_article
     *
     * @mbg.generated
     */
    @SelectProvider(type=MallArticleSqlProvider.class, method="selectByExampleWithBLOBs")
    @Results({
        @Result(column="article_key", property="articleKey", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="app_key", property="appKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="state", property="state", jdbcType=JdbcType.TINYINT),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.INTEGER),
        @Result(column="update_time", property="updateTime", jdbcType=JdbcType.INTEGER),
        @Result(column="type", property="type", jdbcType=JdbcType.INTEGER),
        @Result(column="version", property="version", jdbcType=JdbcType.INTEGER),
        @Result(column="title", property="title", jdbcType=JdbcType.LONGVARCHAR),
        @Result(column="content", property="content", jdbcType=JdbcType.LONGVARCHAR)
    })
    List<MallArticleWithBLOBs> selectByExampleWithBLOBs(MallArticleExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_article
     *
     * @mbg.generated
     */
    @SelectProvider(type=MallArticleSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="article_key", property="articleKey", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="app_key", property="appKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="state", property="state", jdbcType=JdbcType.TINYINT),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.INTEGER),
        @Result(column="update_time", property="updateTime", jdbcType=JdbcType.INTEGER),
        @Result(column="type", property="type", jdbcType=JdbcType.INTEGER),
        @Result(column="version", property="version", jdbcType=JdbcType.INTEGER)
    })
    List<MallArticle> selectByExampleWithRowbounds(MallArticleExample example, RowBounds rowBounds);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_article
     *
     * @mbg.generated
     */
    @SelectProvider(type=MallArticleSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="article_key", property="articleKey", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="app_key", property="appKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="state", property="state", jdbcType=JdbcType.TINYINT),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.INTEGER),
        @Result(column="update_time", property="updateTime", jdbcType=JdbcType.INTEGER),
        @Result(column="type", property="type", jdbcType=JdbcType.INTEGER),
        @Result(column="version", property="version", jdbcType=JdbcType.INTEGER)
    })
    List<MallArticle> selectByExample(MallArticleExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_article
     *
     * @mbg.generated
     */
    @Select({
        "select",
        "article_key, app_key, `state`, create_time, update_time, `type`, version, title, ",
        "content",
        "from mall_article",
        "where article_key = #{articleKey,jdbcType=VARCHAR}"
    })
    @Results({
        @Result(column="article_key", property="articleKey", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="app_key", property="appKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="state", property="state", jdbcType=JdbcType.TINYINT),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.INTEGER),
        @Result(column="update_time", property="updateTime", jdbcType=JdbcType.INTEGER),
        @Result(column="type", property="type", jdbcType=JdbcType.INTEGER),
        @Result(column="version", property="version", jdbcType=JdbcType.INTEGER),
        @Result(column="title", property="title", jdbcType=JdbcType.LONGVARCHAR),
        @Result(column="content", property="content", jdbcType=JdbcType.LONGVARCHAR)
    })
    MallArticleWithBLOBs selectByPrimaryKey(String articleKey);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_article
     *
     * @mbg.generated
     */
    @UpdateProvider(type=MallArticleSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") MallArticleWithBLOBs record, @Param("example") MallArticleExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_article
     *
     * @mbg.generated
     */
    @UpdateProvider(type=MallArticleSqlProvider.class, method="updateByExampleWithBLOBs")
    int updateByExampleWithBLOBs(@Param("record") MallArticleWithBLOBs record, @Param("example") MallArticleExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_article
     *
     * @mbg.generated
     */
    @UpdateProvider(type=MallArticleSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") MallArticle record, @Param("example") MallArticleExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_article
     *
     * @mbg.generated
     */
    @UpdateProvider(type=MallArticleSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(MallArticleWithBLOBs record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_article
     *
     * @mbg.generated
     */
    @Update({
        "update mall_article",
        "set app_key = #{appKey,jdbcType=VARCHAR},",
          "`state` = #{state,jdbcType=TINYINT},",
          "create_time = #{createTime,jdbcType=INTEGER},",
          "update_time = #{updateTime,jdbcType=INTEGER},",
          "`type` = #{type,jdbcType=INTEGER},",
          "version = #{version,jdbcType=INTEGER},",
          "title = #{title,jdbcType=LONGVARCHAR},",
          "content = #{content,jdbcType=LONGVARCHAR}",
        "where article_key = #{articleKey,jdbcType=VARCHAR}"
    })
    int updateByPrimaryKeyWithBLOBs(MallArticleWithBLOBs record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_article
     *
     * @mbg.generated
     */
    @Update({
        "update mall_article",
        "set app_key = #{appKey,jdbcType=VARCHAR},",
          "`state` = #{state,jdbcType=TINYINT},",
          "create_time = #{createTime,jdbcType=INTEGER},",
          "update_time = #{updateTime,jdbcType=INTEGER},",
          "`type` = #{type,jdbcType=INTEGER},",
          "version = #{version,jdbcType=INTEGER}",
        "where article_key = #{articleKey,jdbcType=VARCHAR}"
    })
    int updateByPrimaryKey(MallArticle record);
}